package com.zhaorui.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhaorui.entity.ActivityPrize;
import com.zhaorui.service.ActivityPrizeService;
import com.zhaorui.mapper.ActivityPrizeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 *
 */
@Service
public class ActivityPrizeServiceImpl extends ServiceImpl<ActivityPrizeMapper, ActivityPrize>
        implements ActivityPrizeService {

    @Autowired
    private ActivityPrizeMapper activityPrizeMapper;

    //综合查询
    @Override
    public List<HashMap> queryPrize(ActivityPrize activityPrize) {
        return activityPrizeMapper.queryPrize (activityPrize);
    }


    //根据id查询
    @Override
    public ActivityPrize queryPrizeId(Integer id) {
        return activityPrizeMapper.queryPrizeId (id);
    }

    //增加
    @Override
    public void savePrize(ActivityPrize activityPrize) {
        activityPrizeMapper.savePrize (activityPrize);
    }

    //删除
    @Override
    public boolean delete(Integer id) {
        ActivityPrize activityPrize = activityPrizeMapper.queryPrizeId (id);
        if (activityPrize != null) {
            this.baseMapper.deleteById (id);
            return true;
        }
        return false;
    }

}




